package com.skq.mapper;

import com.github.pagehelper.Page;
import com.skq.pojo.Article;
import org.apache.ibatis.annotations.Insert;

/**
 * @author skq
 * @data 2024/6/11
 */
public interface ArticleMapper {
    //添加文章
    @Insert("insert into article(title, content, cover_img, state, category_id, create_user, create_time, update_time) " +
            "values(#{title}, #{content}, #{coverImg}, #{state}, #{categoryId}, #{createUser}, #{createTime}, #{updateTime})")
    void add(Article article);

    //分页查询文章
    Page<Article> list(Integer userId, String categoryId, String state);
}
